<script type="text/javascript" src="__STATIC__/plugs/jquery-3.4.1/jquery-3.4.1.min.js?v={:time()}"></script>
<script type="text/javascript" src="__STATIC__/plugs/qrcode/jquery.qrcode.min.js?v={:time()}"></script>
<div id="code" style="width:200px;margin:50px auto;"></div>
<script>
	$("#code").qrcode({
		render: "table",
		width: 200,
		height: 200,
		text: "{:url('wechat/wechat/see',['uid'=>$id])}",
	});
	ws = new WebSocket("ws://127.0.0.1:1234");
	ws.onopen = function () {
		console.log("连接成功" + { $id });
		ws.send('uid' + { $id });
	};
	ws.onmessage = function (e) {
		if (e.data == 'close') {
			console.log('关闭成功');
			var index = parent.layer.getFrameIndex(window.name);
			parent.layer.close(index); //再执行关闭
		}
	};
</script>